package com.danskin.wechat.dao;

import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Param;

import com.danskin.wechat.entity.WxFansInfo;
import com.danskin.wechat.entity.WxFansInfoView;
import com.danskin.wechat.entity.example.WxFansInfoExample;
import com.danskin.wechat.util.Page;

public interface WxFansInfoDao {
	List<WxFansInfoView> listPageList(Page page);
	
    int countByExample(WxFansInfoExample example);

    int deleteByExample(WxFansInfoExample example);

    int deleteByPrimaryKey(Integer id);

    /**
     * 新建粉丝
     * @param record
     * @return
     * @author makunsmac
     */
    int insertSelective(WxFansInfo record);

    /**
     * 查询符合条件的粉丝信息
     * @param example
     * @return
     * @author makunsmac
     */
    List<WxFansInfo> selectByExample(WxFansInfoExample example);
    
    List<WxFansInfo> selectAllOpenIdByMpId(@Param("mpId") int mpId);

    WxFansInfo selectByPrimaryKey(Integer id);
    
    WxFansInfo selectByOpenId(@Param("mpId") Integer mpId, @Param("openId") String openId);
    
    WxFansInfo selectByCustExId(@Param("mpId") Integer mpId, @Param("custExId") Integer custExId);

    int updateByExampleSelective(@Param("record") WxFansInfo record, @Param("example") WxFansInfoExample example);

    int updateByExample(@Param("record") WxFansInfo record, @Param("example") WxFansInfoExample example);

    int updateByPrimaryKeySelective(WxFansInfo record);
    
    /**
     * 查询符合条件的粉丝数
     * @param param
     * @return
     * @author makunsmac
     */
    Long selectWxFansInfoCount(WxFansInfo param);
    
    Map<String,Object> selectFanseInfoAndMobileByOpenId(Map<String,Object> map);
    
    
}